package j05zuoye;
/*
猫捉老鼠
定义一个猫类(Cat), 包含颜色(color), 姓名(name)属性, 猫具有吃饭(eat), 睡觉(sleep),抓老鼠(catchMouse)的功能.
方法中只需要做输出即可.例如: eat功能 输出"xxx正在吃鱼", xxx是猫的name
 */
class Cat{
    String color;
    String name;

    public Cat() {
    }

    public Cat(String color, String name) {
        this.color = color;
        this.name = name;
    }

    public void eat(){
        System.out.println(name+"在吃鱼");
    }
    public void sleep(){
        System.out.println(name+"在睡觉");
    }
    public void catchMouse(){
        System.out.println(name+"在抓老鼠");
    }
}
public class J3cat {
    public static void main(String[] args) {
        Cat c1 = new Cat("white","田园猫");
        c1.eat();
        c1.catchMouse();
    }
}
